<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminAdTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_ad', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('positions_id')->comment('分类');
            $table->integer('user_group_id')->comment('团队');
            $table->string('title')->default('')->comment('标题');
            $table->string('author')->default('')->comment('作者');
            $table->string('source')->default('')->comment('来源');
            $table->timestamp('show_at')->comment('发布时间');
            $table->string('cover_path')->default('')->comment('封面图片');
            $table->string('mini_wechat_link')->nullable()->comment('微信小程序外联');
            $table->string('pc_link')->nullable()->comment('网站外联');
            $table->longText('content')->nullable()->comment('内容');
            $table->tinyInteger('audit_status')->default('0')->comment('0 待审核 1审核通过 2审核驳回');
            $table->string('audit_response')->nullable()->comment('审核结果');
            $table->integer('sort')->default('0')->comment('排序');
            $table->tinyInteger('status')->default('1')->comment('0 禁用 1启用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_ad');
    }
}
